Xceed Words for .NET v5.0 Documentation
Welcome to Xceed Words for .NET v5.0 / Code Snippets / Adding a Picture
In This Topic
    Adding a Picture
    In This Topic

    The following example demonstrates how to add a picture in a Document.

    C#
    Copy Code
        // Create a document.
        using( var document = DocX.Create( "AddPicture.docx" ) )
        {
          // Add a simple image from disk.
          var image = document.AddImage( "balloon.jpg" );
          // Set Picture Height and Width.
          var picture = image.CreatePicture( 150, 150 );
          // Insert Picture in paragraph.
          var p = document.InsertParagraph( "Here is a simple picture added from disk:" );
          p.AppendPicture( picture );
          document.Save();
        }